<?php
/**
 * Skyline :: Patterns & component framework
 * Copyright 2010-2011 Ian Unruh (Xerof3ar)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace Skyline\Type;

/**
 * An enumeration is a set of well-defined types that are strictly validated
 * 
 * <b>Usage example #1:</b>
 * <code>
 * class Gender extends AbstractEnumeration {
 *   const FEMALE = 'FEMALE';
 *   const MALE = 'MALE';
 * }
 * $gender = new Gender(Gender::MALE);
 * </code>
 * 
 * Now for the real benefit, a consumer of this enumeration:
 * 
 * <b>Usage example #2:</b>
 * <code>
 * class User {
 *   // ...
 *   public function setGender(Gender $gender) {
 *     // ...
 *   }
 *   // ...
 * }
 * 
 * $user = new User();
 * 
 * $user->setName('Tally');
 * $user->setGender(new Gender(Gender::FEMALE));
 * 
 * // ...
 * </code>
 * 
 * No extra validation, just one straight-forward type; now you can rely
 * on IDE auto-completion and syntax checking to validate types instead of using
 * strings or other constants with the risk of typos.
 * 
 * @author Ian Unruh (Xerof3ar) <ianunruh@gmail.com>
 * @since Class avaliable since release 1.0
 */
interface EnumerationInterface
{
	/**
	 * Returns the type being represented by this enumeration
	 * @return string
	 */
	public function getType();
	
	/**
	 * Returns this enumeration as a string value
	 * @return string
	 */
	public function __toString();
}